package com.cdyx.yygh.cmn.EasyExcel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;

import java.util.LinkedList;
import java.util.List;

public class ExcelTest {
    public static void main(String[] args) {
        List<UserData> list=new LinkedList<>();
        for (int i = 1; i <15 ; i++) {
            UserData user=new UserData();
            user.setUserCode("0010"+i);
            user.setUserName("lucy"+i);
            list.add(user);
        }
        String fileName="D:\\excel\\01.xlsx";
         EasyExcel.write(fileName, UserData.class).sheet("数据字典").doWrite(list);
    }
}
